<!DOCTYPE html >
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:p="http://primefaces.org/ui"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:c="http://java.sun.com/jsp/jstl/core"
      xmlns:f="http://java.sun.com/jsf/core">
    <h:head>
        <title>BioDesk #{userController.loggedUser.userLogin}</title>
        <h:outputStylesheet name="css/style.css"/>
        <h:outputScript library="js" name="biodesk.js" target="head" />
        <p:growl id="growl" showDetail="true" life="10000" autoUpdate="true"/>
        <h:form>
            <p:idleMonitor onidle="dlgSessionExpired.show()" timeout="300000" />
            <p:dialog draggable="false" resizable="false" modal="true"
                      closable="false" widgetVar="dlgSessionExpired"
                      width="400" height="250" header="Message">
                <center>
                    <h:outputText value="Your session has been expired!!" /><br/>
                    <h:graphicImage url="/resources/images/syscon/exp_time.png"/>
                    <br/>
                    <p:commandButton ajax="false" value="Enter again" action="#{userController.logout}">
                        <f:setPropertyActionListener target="#{userController.loggedIn}" value="false"/>
                    </p:commandButton>
                </center>
            </p:dialog>
            <p:dialog draggable="false" resizable="false" modal="true" rendered="#{userController.loggedUser == null}"
                      closable="false" widgetVar="dlgSessionExpired"
                      width="400" height="250" header="Message" visible="true">
                <center>
                    <h:outputText value="Not Logged!" /><br/>
                    <h:graphicImage url="/resources/images/syscon/ops2.png"/>
                    <br/>
                    <p:commandButton ajax="false" value="Enter again" action="login">
                    </p:commandButton>
                </center>
            </p:dialog>
        </h:form>
    </h:head>

    <p:layout fullPage="true" rendered="#{userController.loggedUser != null}" >

        <p:layoutUnit position="west" size="200" header="Your Options" resizable="true" closable="true" collapsible="true" collapsed="true"  >
            <center>
                <h:form>

                </h:form>
            </center>
        </p:layoutUnit>

        <p:layoutUnit position="east" size="200" header="Right" resizable="true" closable="true" collapsible="true" effect="drop" collapsed="true">
            <ui:insert name="right">
                <h:outputText value="Right unit content." />
            </ui:insert>
        </p:layoutUnit>

        <p:layoutUnit position="south" size="120" header="Bottom" resizable="true" closable="true" collapsible="true" collapsed="true" visible="false">
            <div id="footer" class="ui-widget ui-widget-header ui-corner-all">
                <p class="copyright">#{bundle.SysTitle} User: #{userController.username} Last Login: #{userController.lastLogin} - ©  2011-2012  • <a href="http://www.bioinfo.ufpr.br/">BioInfo</a>.</p>
                <p style="float:right">Running PrimeFaces-3.1 SNAPSHOOT</p>
            </div>
        </p:layoutUnit>
        <div class="customBG">
            <p:layoutUnit position="center"  >
                <h:form >
                    <div id="box" class="menu_left" >
                        <c:if test="#{userController.allowedGroups('2,3')}">
                            <h:commandLink action="index" immediate="true"  styleClass="menu_item">
                                <div >
                                    <h:graphicImage  value="/resources/images/syscon/home.png" />
                                    <br/>
                                    <h:outputText  value="Home"/>
                                </div>
                            </h:commandLink>
                            <br/>
                            <h:commandLink action="/user/List" immediate="true"  styleClass="menu_item">
                                <div >
                                    <h:graphicImage  value="/resources/images/syscon/user_control.png" />
                                    <br/>
                                    <h:outputText  value="Users"/>
                                </div>
                            </h:commandLink>
                            <br/>
                            <h:commandLink action="/userGroup/List" immediate="true"  styleClass="menu_item">
                                <div >
                                    <h:graphicImage  value="/resources/images/syscon/user_group.png" />
                                    <br/>
                                    <h:outputText  value="Groups"/>
                                </div>
                            </h:commandLink>
                            <br/>

                            <h:commandLink action="/project/List" immediate="true"  styleClass="menu_item">
                                <div >
                                    <h:graphicImage  value="/resources/images/syscon/proj.png"  />
                                    <br/>
                                    <h:outputText  value="Projects"/>
                                </div>
                            </h:commandLink> <br/>
                            <h:commandLink action="/genBank/List" immediate="true"  styleClass="menu_item">
                                <div >
                                    <h:graphicImage  value="/resources/images/syscon/genbank.png"  />
                                    <br/>
                                    <h:outputText  value="GenBanks"/>
                                </div>
                            </h:commandLink> <br/>
                            <h:commandLink action="/fasta/List" immediate="true"  styleClass="menu_item">
                                <div >
                                    <h:graphicImage  value="/resources/images/syscon/fasta.png"  />
                                    <br/>
                                    <h:outputText  value="Fastas"/>
                                </div>
                            </h:commandLink> <br/>
                            <h:commandLink action="#{userController.logout}" immediate="true"  styleClass="menu_item">
                                <div >
                                    <h:graphicImage  value="/resources/images/syscon/logout_icon.png"  />
                                    <br/>
                                    <h:outputText  value="Logout"/>
                                </div>
                            </h:commandLink>
                        </c:if>
                    </div>
                </h:form>
                <center  >
                    <ui:insert name="body" >

                    </ui:insert>
                </center>
            </p:layoutUnit>
        </div>
    </p:layout>
</html>
